import request from "./config";

// 获取用户列表(分页)
export const getUserList = (params) => {
  return request({
    url: `/api/user/list`,
    method: "get",
    params,
  });
};

// 封禁/解封用户
export const banUser = (data) => {
  return request({
    url: `/api/admin/editUserStatus`,
    method: "post",
    data,
  });
};

//审核
export const auditArticle = (data) => {
  return request({
    url: `/api/articles/audit`,
    method: "post",
    data,
  });
};

// 审核记录
export const getAuditList = (params) => {
  return request({
    url: `/api/articles/audit-records`,
    method: "get",
    params,
  });
};

export const adminLogin = (data) => {
  return request({
    url: `/api/admin/login`,
    method: "post",
    data,
  });
};

export const adminRegister = (data) => {
  return request({
    url: `/api/admin/register`,
    method: "post",
    data,
  });
};
